#if !defined(CELL_H)
#define CELL_H


#include <string>


class Piece;
class Board;

enum PieceType {KING, QUEEN, ROOK, KNIGHT, BISHOP, PAWN};
enum PieceColor {WHITE, BLACK};


///@brief An interface for the %Cell class that holds a piece (real or empty).
/// This class also has directional functions for adjacent cells. 
class Cell {

	public:
		Cell();
		///@param piece is the Piece object to which this %Cell will point.
		Cell(Board* board, int row, int col);
		///@note This dtor does nothing special, as %Cell allocates nothing on the heap.
		~Cell();
		
		//Setters
		void BindToPiece(Piece* piece);
		
		//Getters
		Piece* GetPiece();
		int GetRow();
		int GetCol();


		//Directional Methods
		Cell* FdLeft(PieceColor color);
		Cell* Fd(PieceColor color);
		Cell* FdRight(PieceColor color);
		Cell* Left(PieceColor color);
		Cell* Right(PieceColor color);
		Cell* BkLeft(PieceColor color);
		Cell* Bk(PieceColor color);
		Cell* BkRight(PieceColor color);

		std::string toString();

		std::string getTypeString(PieceType type){
			std::string typeString = "" ;
			switch(type)
			{
			case ROOK: typeString = "ROOK"; break;
			case KING: typeString = "KING"; break;
			case QUEEN: typeString = "QUEEN"; break;
			case KNIGHT: typeString = "KNIGHT"; break;
			case BISHOP: typeString = "BISHOP"; break;
			case PAWN: typeString = "PAWN"; break;
			}
			return typeString;
		}
		std::string getColorString(PieceColor color){
			std::string typeString = "" ;
			switch(color)
			{
			case BLACK: typeString = "BLACK"; break;
			case WHITE: typeString = "WHITE"; break;
			}
			return typeString;
		}


	protected:
		int row;
		int col;
		Board* board;
		Piece* piece;
		
};

#endif
